﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
	CodeBehind="Create.aspx.cs" Inherits="TraceThisItem.WebUI.Items.Create" %>

<asp:Content ID="Head" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">
	<h1>
		Agregar nueva incidencia
	</h1>
	<hr />
	<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
	<h4>
		<asp:Label ID="lblBigMessage" class="failureNotification" Visible="false" Text=""
			runat="server" />
	</h4>
	<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
		<tr>
			<td style="width: 150px; text-align: right;">
				<asp:Label ID="lblMisProyectos" Text="Proyecto:" runat="server" AssociatedControlID="ProjectDropDownList" />
			</td>
			<td>
				<asp:DropDownList ID="ProjectDropDownList" runat="server" AutoPostBack="True" DataSourceID="ProjectDataSource"
					DataTextField="Name" DataValueField="Id" Width="159px">
				</asp:DropDownList>
			</td>
		</tr>
		<tr>
			<td style="text-align: right;">
				<asp:Label ID="lblPrioridad" Text="Prioridad:" runat="server" AssociatedControlID="PriorityDropDownList" />
			</td>
			<td>
				<asp:DropDownList ID="PriorityDropDownList" runat="server" AutoPostBack="True" Width="159px">
					<asp:ListItem Value="0">Alta</asp:ListItem>
					<asp:ListItem Selected="True" Value="1">Normal</asp:ListItem>
					<asp:ListItem Value="2">Baja</asp:ListItem>
				</asp:DropDownList>
			</td>
		</tr>
		<tr>
			<td style="text-align: right;">
				<asp:Label ID="lblTeams" Text="Equipo:" runat="server" AssociatedControlID="TeamsDropDownList" />
			</td>
			<td>
				<asp:DropDownList ID="TeamsDropDownList" runat="server" AutoPostBack="True" Width="159px"
					DataSourceID="TeamsDataSource" DataTextField="Name" DataValueField="Id">
				</asp:DropDownList>
			</td>
		</tr>
		<tr>
			<td style="text-align: right;">
				<asp:Label ID="lblAsunto" Text="Asunto:" runat="server" AssociatedControlID="txtAsunto" />
			</td>
			<td>
				<asp:TextBox ID="txtAsunto" MaxLength="50" runat="server" Width="300px" /><br />
				<asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="failureNotification"
					ErrorMessage="La incidencia debe tener obligatoriamente un asunto" ControlToValidate="txtAsunto"
					runat="server" Display="Dynamic" />
			</td>
		</tr>
		<tr>
			<td style="text-align: right;">
				<asp:Label ID="Label1" Text="Descripción:" runat="server" AssociatedControlID="txtDescripcion" />
			</td>
			<td>
				<asp:TextBox ID="txtDescripcion" runat="server" TextMode="MultiLine" Rows="4" Columns="40" /><br />
				<asp:RequiredFieldValidator ID="RequiredFieldValidator2" CssClass="failureNotification"
					ErrorMessage="La incidencia debe contener al menos una breve descripción" ControlToValidate="txtDescripcion"
					runat="server" Display="Dynamic" />
			</td>
		</tr>
		<tr>
			<td style="text-align: right;">
				<asp:Label ID="lblComentarios" Text="Comentarios:" runat="server" AssociatedControlID="txtComentarios" />
			</td>
			<td>
				<asp:TextBox ID="txtComentarios" runat="server" TextMode="MultiLine" Rows="4" Columns="40" />
			</td>
		</tr>
		<tr>
			<td style="text-align: right;">
				<asp:Label ID="lblItemTypes" Text="Tipo de Item" runat="server" AssociatedControlID="ItemTypesDropDownList" />
			</td>
			<td>
				<asp:DropDownList ID="ItemTypesDropDownList" runat="server" AutoPostBack="True" DataSourceID="ItemTypesDataSource"
					DataTextField="Name" DataValueField="Id" Width="159px">
				</asp:DropDownList>
			</td>
		</tr>
		<tr>
			<td style="text-align: right;">
				<asp:Label ID="lblResponsable" Text="Responsable" runat="server" AssociatedControlID="ResponsableDropDownList" />
			</td>
			<td>
				<asp:DropDownList ID="ResponsableDropDownList" runat="server" AutoPostBack="True"
					Width="159px" DataSourceID="ResponsableDataSource" DataTextField="FullName" DataValueField="UserName">
				</asp:DropDownList>
			</td>
		</tr>
	</table>
	<p style="padding-left: 160px;">
		<asp:Button ID="btnAgregarIncidencia" Text="Agregar incidencia" runat="server" OnClick="btnAgregarIncidencia_Click" />
	</p>
	<asp:ObjectDataSource ID="ItemTypesDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
		OnObjectCreating="ItemTypesDataSource_ObjectCreating" SelectMethod="GetItemTypesFromProject"
		TypeName="TraceThisItem.Domain.Facade" OnSelected="ItemTypesDataSource_Selected">
		<SelectParameters>
			<asp:ControlParameter ControlID="ProjectDropDownList" Name="projectId" PropertyName="SelectedValue"
				Type="Int32" />
		</SelectParameters>
	</asp:ObjectDataSource>
	<asp:ObjectDataSource ID="TeamsDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
		OnObjectCreating="TeamsDataSource_ObjectCreating" SelectMethod="GetTeamsByProjectId"
		TypeName="TraceThisItem.Domain.Facade">
		<SelectParameters>
			<asp:ControlParameter ControlID="ProjectDropDownList" Name="projectId" PropertyName="SelectedValue"
				Type="Int32" />
		</SelectParameters>
	</asp:ObjectDataSource>
	<asp:ObjectDataSource ID="ResponsableDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
		OnObjectCreating="ResponsableDataSource_ObjectCreating" OnSelected="ResponsableDataSource_Selected"
		SelectMethod="GetUsersByProject" TypeName="TraceThisItem.Domain.Facade">
		<SelectParameters>
			<asp:ControlParameter ControlID="ProjectDropDownList" Name="projectId" PropertyName="SelectedValue"
				Type="Int32" />
		</SelectParameters>
	</asp:ObjectDataSource>
	<asp:ObjectDataSource ID="ProjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
		SelectMethod="GetProjectsByUser" TypeName="TraceThisItem.Domain.Facade" OnObjectCreating="ProjectDataSource_ObjectCreating"
		OnSelecting="ProjectDataSource_Selecting" OnSelected="ProjectDataSource_Selected">
		<SelectParameters>
			<asp:Parameter Name="userName" Type="String" />
		</SelectParameters>
	</asp:ObjectDataSource>
</asp:Content>
